﻿package mortal.component.window
{
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.mvc.core.*;
    import mortal.mvc.interfaces.*;

    public class NpcWindow extends Window
    {

        public function NpcWindow(param1:ILayer = null)
        {
            super(param1);
            return;
        }// end function

        override protected function dispatchHideEvent() : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.NPCDialogWindowHide));
            super.dispatchHideEvent();
            this.dispatchEvent(new WindowEvent(WindowEvent.CLOSE_END));
            return;
        }// end function

        override protected function dispatchShowedEvent() : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.NPCDialogWindowShow));
            super.dispatchShowedEvent();
            this.dispatchEvent(new WindowEvent(WindowEvent.SHOW_END));
            return;
        }// end function

        override public function show(param1:int = 0, param2:int = 0) : void
        {
            if (!LayerManager.npcDialogLayr.isCanShow())
            {
                super.hide();
            }
            else
            {
                LayerManager.npcDialogLayr.removeAllWindow();
                super.show(param1, param2);
            }
            return;
        }// end function

    }
}
